<?php

namespace api\controllers;

use api\controllers\SpokesmanbaseController;
use bc\util\Util;
use bc\model\BankcardModel;
use bc\model\BankModel;

class BankcardController extends SpokesmanbaseController{
    
    protected function verbs()
	{
		return [
			'Getcard' => ['POST']
		];
	}
    
    /*
     * 获取银行卡信息
     */
    public function  actionGetcard()
        {      
               $userId = 4230 ;
               
               $model = new BankcardModel();
               $params = array(
                         "bc_bank_card.user_id"  => $userId,
                         "bc_bank_card.is_del" =>  0,
                            );             
               $cardInfo = $model -> getCardInfo($params);
;
               $bankModel = new BankModel();
               $bankList = $bankModel -> getList('');

               $data = array(
                       
			 'cardInfo'=>['card_id'=>$cardInfo['card_id'],'bank_name'=>$cardInfo['bank_name'],'card_no'=>$cardInfo['card_number'],'balance'=>$cardInfo['balance']],
			 'bankList'=>$bankList              
                           
                    );

              
              $this->echoJosnpData(0,$data);              
               
                
        }
}